<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame
		Remove this if you use the .htaccess -->
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<title>javascript01</title>
		<meta name="description" content="" />
		<meta name="author" content="Student26" />
		<meta name="viewport" content="width=device-width; initial-scale=1.0" />
		<!-- Replace favicon.ico & apple-touch-icon.png in the root of your domain and delete these references -->
		<link rel="shortcut icon" href="/favicon.ico" />
		<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
	</head>
	<body>
		<script>
			//var : 전역변수 / var가 없으면 : 지역변수
			var a=10;
			var b="hello";
			var c=true;
			d=0;
			e="bye";
			
			//Object
			var person=new Object();
			person.name="냐옹";
			person.age=30;
			person.city="서울";
			console.log("person :", person);
			
			person={firstname:"John",lastname:"Doe",age:50,eyecolor:"blue"};
			console.log("person :", person);
			
			function Taxi(money, location){
				this.money=money;
				this.location=location;
				
				this.changeMoney=function(newMoeny){
					this.money=money+newMoeny;
				}
			}
			
			var taxi1=new Taxi(300, "강북");
			console.log("money : ", taxi1.money);
			console.log("location : ", taxi1.location);
			taxi1.changeMoney(500);
			console.log("after money : ", taxi1.money);
			
			console.log("--------------------------------------");
			
			for(x in person){
				console.log("person : ", person[x]);
			}
					
			function hellow(){
				d=b.length;
				a++;
				
				alert("hello".toUpperCase()+a+" hellow의 길이 : "+d);
			}
			
			console.log("--------------------------------------");
					
		</script>
		<button onclick="hellow();">누르세요</button>
		<script>
			var buttons=document.getElementsByTagName("button");
			var button=buttons[0];
			for(x in button){
				console.log("button: ", x);
			}
		</script>
	</body>
</html>
